/**
 * @author 2404559603@qq.com
 * @time 2022-04-24 9:40 PM
 * @description 我的页面接口封装
 */
import Ajax from "./Ajax"


// 获取订单
export function myGoods(id) {  
    return Ajax({
        url:'/order/list/'+id
    })
}

// 收货
export function orderFin(data) {  
    return Ajax({
        url:'/order/finish',
        method:'post',
        data
    })
}
// 取消
export function orderCan(data) {  
    return Ajax({
        url:'/order/cancel',
        method:'post',
        data
    })
}

// 获取用户地址
export function myAddress(id) {  
    return Ajax({
        url:'/address/'+id
    })
}

// 添加用户地址
// {userId: string, name: string, phone: string, address: string, tag: string}
export function addAddress(data) {  
    return Ajax({
        url:'/address/add',
        method:'put',
        data
    })
}

// 修改用户地址
export function editAddress(data) {  
    return Ajax({
        url:'/address/modify',
        method:'post',
        data
    })
}

// 删除
export function del(userid,id) {  
    return Ajax({
        url:'/address/'+userid+'/'+id,
        method:'delete'
    })
}


// 获取优惠卷
export function getcouponlist() {  
    return Ajax({
        url:'/coupon/list',
    })
}